import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '@/views/login/IndexView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: LoginView,
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView,
    },
    {
      path: '/view',
      name: 'view',
      component: () => import('@/views/view/IndexView.vue'),
      children: [
        {
          path: '/home',
          name: 'home',
          component: () => import('@/views/home/IndexView.vue'),
        },
        {
          path: '/products',
          name: 'products',
          component: () => import('@/views/products/IndexView.vue'),
        },
        {
          path: '/orders',
          name: 'orders',
          component: () => import('@/views/orders/IndexView.vue'),
        },
        {
          path: '/logistics/providers',
          name: 'logistics/providers',
          component: () => import('@/views/logistics/ProvidersView.vue'),
        },
        {
          path: '/logistics/orders',
          name: 'logistics/orders',
          component: () => import('@/views/logistics/OrdersView.vue'),
        },
        {
          path: '/dsf',
          name: 'dsf',
          component: () => import('@/views/dsf/IndexView.vue'),
        },
        {
          path: '/setting',
          name: 'setting',
          component: () => import('@/views/setting/IndexView.vue'),
        },
        // {
        //   path: 'user',
        //   name: 'user',
        //   component: () => import('@/views/view/UserView.vue'),
        // },
      ],
    },
  ],
})

export default router
